<template>
  <div class="app-container">
    <el-table :data="list">
      <el-table-column label="入库时间" align="center" prop="InputTime" />
      <el-table-column label="车牌号" align="center" prop="CarNo" />
      <el-table-column label="入库件数" align="center" prop="InputCout" />
      <el-table-column label="入库吨数" align="center" prop="InputTon" />
    </el-table>

    <div>
      <span>
        入库总吨数{{ totalWight }}吨</span>
    </div>
  </div>
</template>

<script>


export default {
  // 港口公司场地管理进货
  name: "Input",
  props: {
    list: {
      type: Array,
      default: []
    }
  },
  watch:{
list(newV,old) {
  this.dataList = newV
 
  this.totalWight = this.gettotlaMoney(newV,"InputTon")
}
  },
  data() {
    return {
       dataList:[],
       totalWight: 0

    }

  },
  
 
  methods: {
    gettotlaMoney(arr = [], key) {
      let tem = 0;
      arr.forEach(item => {
        tem = tem + parseInt(item[key])
      })
      return tem;
    },
  }

}

</script>
